package com.ruoyi.ucar.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.ucar.common.CommonVoResp;
import com.ruoyi.ucar.service.ITOrderService;
import com.ruoyi.ucar.voreq.TotalCountVoReq;
import com.ruoyi.ucar.voresp.OrderTotalCountDataVoResq;
import com.ruoyi.ucar.voresp.ProductTotalCountDataVoResq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/ucar/index")
@Api(value = "首页管理",tags = "首页统计管理模块接口")
public class IndexController extends BaseController {

    @Autowired
    private ITOrderService tOrderService;

    @ApiOperation("订单数据统计")
    @PostMapping("/orderTotalCount")
     public CommonVoResp<OrderTotalCountDataVoResq>  orderTotalCount(@RequestBody TotalCountVoReq totalCountVoReq){
        CommonVoResp<OrderTotalCountDataVoResq> commonVoResp=new CommonVoResp<>();
        commonVoResp.setData(tOrderService.orderTotalCount(totalCountVoReq));
        return commonVoResp;
     };
    @ApiOperation("产品数据统计")
    @PostMapping("/productTotalCount")
    public CommonVoResp<ProductTotalCountDataVoResq>  productTotalCount(@RequestBody TotalCountVoReq totalCountVoReq){
        CommonVoResp<ProductTotalCountDataVoResq> commonVoResp=new CommonVoResp<>();
        commonVoResp.setData(tOrderService.productTotalCount(totalCountVoReq));
        return commonVoResp;
    };


}